<template>
	<view class="container">
		<view class="detail-box" v-for="(item,index) in accountData" :key="index">
			<view class="item">
				<view class="left">{{item.source}}</view>
				<view class="right">{{item.type_text + item.num}}</view>
			</view>
			<view class="time">{{item.create_time}}</view>
		</view>
	</view>
</template>

<script>
	import {account} from "../../api/balance.js"
	export default{
		data(){
			return{
				num:0,
				accountData:[]
			}
		},
		onReachBottom() {
			this.getData()
		},
		onLoad() {
			this.getData()
		},
		methods:{
			getData(){
				this.num ++
				this.post(account,{
					user_id:uni.getStorageSync("userInfo").id,
					page:this.num
				}).then(res => {
					if(res.code == 1){
						res.data.data.forEach(item=>{
							this.accountData.push(item)
						})
					}
				})
			}
		}
	}
</script>

<style>
	.detail-box{
		width: 690rpx;
		margin: 40rpx auto;
		border-bottom: 1px solid #D4D4D4;
		padding-bottom: 10rpx;
	}
	.item{
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.left{
		font-size: 30rpx;
		font-weight: 500;
		color: #333333;
	}
	.right{
		font-size: 30rpx;
		font-weight: 800;
		color: #333333;
	}
	.time{
		font-size: 30rpx;
		font-weight: 300;
		color: #333333;
		line-height: 33rpx;
	}
</style>
